//
//  Tree_3.m
//  TheifRunning
//
//  Created by Lion on 6/13/14.
//  Copyright (c) 2014 Apportable. All rights reserved.
//

#import "Tree_3.h"

@implementation Tree_3{
    CCNode *_tree;
}


#define ARC4RANDOM_MAX      0x100000000
// visibility on a 3,5-inch iPhone ends a 88 points and we want some meat
static const CGFloat minimumXPosition = 0;
// visibility ends at 480 and we want some meat
static const CGFloat maximumXPosition = 100;

static const CGFloat minimumYPosition = 0;
static const CGFloat maximumYPosition = 20;
- (void)setupRandomPosition {
    // value between 0.f and 1.f
    CGFloat random = ((double)arc4random() / ARC4RANDOM_MAX);
    CGFloat rangeX = maximumXPosition - minimumXPosition;
    
    CGFloat rangeY = maximumYPosition - minimumYPosition;
    _tree.position = ccp(_tree.position.x + (random * rangeX), _tree.position.y - (random * rangeY));
}
@end
